<?php
/**
 * User: zj
 * Date: 2017/5/22
 * Time: 14:56
 * Progress:0%
 */

namespace app\shop\controller;


use icontroller\admin\AController;
use icontroller\admin\shop\IShopRegUserOrder;
use logic\admin\shop\LShopRegUserOrder;

class ShopRegUserOrder extends AController implements IShopRegUserOrder
{
    private $logic;
    function __construct()
    {
        parent::__construct();
        $this->logic = new LShopRegUserOrder();
    }

    public function index()
    {
        return view();
    }

    public function index_data()
    {
        $param=array(
            'search'=>input('search'),
            'limit'=>input('limit'),
            'offset'=>input('offset'),
            'ordinal'=>input('ordinal'),
            'order'=>input('order'),
            'type'=>input('type'),
            'status'=>input('status'),
            'begindate'=>input('begindate'),
            'enddate'=>input('enddate'),
        );
        $data=$this->logic->index_data($param);
        return $data;
    }

    public function detail(){
        $id=input('id');
        $data=$this->logic->detail_data($id);
        $this->assign('data',$data);
        return view();
    }

    public function grant_gift()
    {
        $id=input('id');
        $data=$this->logic->grant_gift_data($id);
        $this->assign('data',$data);
        return view();
    }

    //礼品领取审核
    public function confirm_gift()
    {
        $param=array(
            'id'=>input('id'),
            'gift_code'=>input('gift_code'),
        );
        return $this->logic->confirm_gift_data($param);
    }
}